package com.hitales.liteflow.liteflowdemo.overwritedemo;

import com.yomahub.liteflow.core.FlowExecutor;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class IsAccessDemo {

    @Resource
    private FlowExecutor flowExecutor;

    /**
     * 下面代码在guest001的情况下会执行[X]skip component[checkUser]
     */
    @GetMapping("access")
    public void test(){
        System.out.println("===== 测试 admin001 =====");
        flowExecutor.execute2Resp("demoChain", "admin001");

        System.out.println("===== 测试 guest001 =====");
        flowExecutor.execute2Resp("demoChain", "guest001");
    }
}
